<?php
/**
 * autoloader.php
 * Created on 2015-07-21
 * Create by yuebin
 */

namespace haibao\classlibrary\comment;
class Autoloader {
	public static function autoLoad($className){
		$nameSpacePre = 'haibao\comment';
		$end = strlen($className);
		$start = strlen($nameSpacePre);
		if ($end > $start){
			if (substr($className,0,$start) == $nameSpacePre){
				$file = dirname(__FILE__) . strtolower(substr($className,$start,$end)) . '.php';
				$file = str_replace('\\', DIRECTORY_SEPARATOR, $file);
				if (file_exists($file)){

					include_once $file;
				}
			}
		}
	}
}

#include_once \haibao\cms\Config::CLASSLIBRARY_BASE_PATH;
spl_autoload_register(array('haibao\classlibrary\comment\Autoloader','autoLoad'));
